//
//  SecondViewController.m
//  Homework 2016-06-14
//
//  Created by Roach on 16/6/14.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "SecondViewController.h"
#import "PictureView.h"
#import "ClownScrollView.h"
@interface SecondViewController ()<UIScrollViewDelegate>

@end

@implementation SecondViewController

- (void)viewDidLoad {
    
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"第二页";
    [self creatSubView];
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)creatSubView {
    
    ClownScrollView *scroll = [[ClownScrollView alloc]initWithFrame:CGRectMake(0, 0, 300, 500)];
    scroll.center = self.view.center;
    scroll.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:scroll];
    [scroll release];
    
    // 创建图片数组
    UIImage *image1 = [UIImage imageNamed:@"a1.jpg"];
    UIImage *image2 = [UIImage imageNamed:@"a2.jpg"];
    UIImage *image3 = [UIImage imageNamed:@"a3.jpg"];
    UIImage *image4 = [UIImage imageNamed:@"a4.jpg"];
    UIImage *image5 = [UIImage imageNamed:@"a5.jpg"];
    UIImage *image6 = [UIImage imageNamed:@"a6.jpg"];
    NSArray *picArray = @[image1, image2, image3, image4, image5, image6];
    
    scroll.delegate = self;
    [scroll addPictures:picArray];
    
    
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
